package com.ruoyi.project.surveys.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.surveys.mapper.SurveysQuestionMotifMapper;
import com.ruoyi.project.surveys.domain.SurveysQuestionMotif;
import com.ruoyi.project.surveys.service.ISurveysQuestionMotifService;

/**
 * 题目主题Service业务层处理
 * 
 * @author zhimin-hu
 * @date 2020-05-02
 */
@Service
public class SurveysQuestionMotifServiceImpl implements ISurveysQuestionMotifService 
{
    @Autowired
    private SurveysQuestionMotifMapper surveysQuestionMotifMapper;

    /**
     * 查询题目主题
     * 
     * @param questionMotifId 题目主题ID
     * @return 题目主题
     */
    @Override
    public SurveysQuestionMotif selectSurveysQuestionMotifById(Long questionMotifId)
    {
        return surveysQuestionMotifMapper.selectSurveysQuestionMotifById(questionMotifId);
    }

    /**
     * 查询题目主题列表
     * 
     * @param surveysQuestionMotif 题目主题
     * @return 题目主题
     */
    @Override
    public List<SurveysQuestionMotif> selectSurveysQuestionMotifList(SurveysQuestionMotif surveysQuestionMotif)
    {
        return surveysQuestionMotifMapper.selectSurveysQuestionMotifList(surveysQuestionMotif);
    }

    /**
     * 新增题目主题
     * 
     * @param surveysQuestionMotif 题目主题
     * @return 结果
     */
    @Override
    public int insertSurveysQuestionMotif(SurveysQuestionMotif surveysQuestionMotif)
    {
        surveysQuestionMotif.setCreateTime(DateUtils.getNowDate());
        return surveysQuestionMotifMapper.insertSurveysQuestionMotif(surveysQuestionMotif);
    }

    /**
     * 修改题目主题
     * 
     * @param surveysQuestionMotif 题目主题
     * @return 结果
     */
    @Override
    public int updateSurveysQuestionMotif(SurveysQuestionMotif surveysQuestionMotif)
    {
        surveysQuestionMotif.setUpdateTime(DateUtils.getNowDate());
        return surveysQuestionMotifMapper.updateSurveysQuestionMotif(surveysQuestionMotif);
    }

    /**
     * 批量删除题目主题
     * 
     * @param questionMotifIds 需要删除的题目主题ID
     * @return 结果
     */
    @Override
    public int deleteSurveysQuestionMotifByIds(Long[] questionMotifIds)
    {
        return surveysQuestionMotifMapper.deleteSurveysQuestionMotifByIds(questionMotifIds);
    }

    /**
     * 删除题目主题信息
     * 
     * @param questionMotifId 题目主题ID
     * @return 结果
     */
    @Override
    public int deleteSurveysQuestionMotifById(Long questionMotifId)
    {
        return surveysQuestionMotifMapper.deleteSurveysQuestionMotifById(questionMotifId);
    }
}
